<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        const Single = (function() {
            function Student() {}
            let _student
            return function() {
                _student = _student || new Student()
                return _student
            }
        })()
        const s1 = new Single()
        const s2 = new Single()
        console.log(s1, s2);
        console.log(s1 === s2);
    </script>
</body>
</html>